From 048f1a170afcb6ee246cf2e074603435ed368d83 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 14 Jul 2015 17:41:04 +0100 Subject: [PATCH] libxl: don't check s!=NULL in libxl__abs_path That argument should not be NULL. Let subsequent dereferencing crashes the process. Signed-off-by: Wei Liu Acked-by: Ian Jackson --- tools/libxl/libxl_internal.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c index 42d548eb54..24a09010e9 100644 --- a/tools/libxl/libxl_internal.c +++ b/tools/libxl/libxl_internal.c @@ -233,8 +233,7 @@ void libxl__log(libxl_ctx *ctx, xentoollog_level msglevel, int errnoval, char *libxl__abs_path(libxl__gc *gc, const char *s, const char *path) { - if (!s || s[0] == '/') - return libxl__strdup(gc, s); + if (s[0] == '/') return libxl__strdup(gc, s); return libxl__sprintf(gc, "%s/%s", path, s); } -- 2.30.2